home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-02-26 | 5.5 KB | 260 lines | [TEXT/MPS ] |
- /*
- File: examplecodec.r
-
- Copyright: © 1991-1996 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #define UseExtendedThingResource 1
-
- #include "Types.r"
- #include "MPWTypes.r"
- #include "ImageCodec.r"
-
- #define exampleCodecFormatName "Example - YUV"
-
- #define exampleCodecFormatType 'exmp'
-
- #ifndef NOASM
- #define NOASM 0
- #endif
-
- #ifndef COMP_BUILD
- #define COMP_BUILD 0
- #endif
-
- #ifndef DECO_BUILD
- #define DECO_BUILD 0
- #endif
-
- #if (DECO_BUILD == 0) && (COMP_BUILD == 0)
- you need to build something....;
- #endif
-
- /*
-
- This structure defines the capabilities of the codec.
-
- */
- #if (defined(POWERPC_FAT)) | (!defined(POWERPC_NATIVE))
- resource 'cdci' (128, "Example CodecInfo",locked) {
- exampleCodecFormatName, /* name of the codec TYPE ( data format ) */
- 1, /* version */
- 1, /* revision */
- 'appl', /* who made this codec */
- codecInfoDoes32 + codecInfoDoesSpool, /* depth and etc. supported directly on decompress */
- codecInfoDoes32 + codecInfoDoesSpool, /* depth and etc supported directly on compress */
- codecInfoDepth16, /* which data formats do we understand */
- 100, /* compress accuracy (0-255) (relative to format) */
- 100, /* decompress accuracy (0-255) (relative to format) */
- #if NOASM
- 200, /* millisecs to compress 320x240 image on base Mac */
- 200, /* millisecs to decompress 320x240 image on base Mac */
- #else
- 100, /* millisecs to compress 320x240 image on base Mac */
- 100, /* millisecs to decompress 320x240 image on base Mac */
- #endif
- 100, /* compression level (0-255) (relative to format) */
- 0,
- 2, /* minimum height */
- 2, /* minimum width */
- 0,
- 0,
- 0
- };
- #endif
-
- #ifdef POWERPC_NATIVE
- resource 'cdci' (129, "Example CodecInfo",locked) {
- exampleCodecFormatName, /* name of the codec TYPE ( data format ) */
- 1, /* version */
- 1, /* revision */
- 'appl', /* who made this codec */
- codecInfoDoes32 + codecInfoDoesSpool, /* depth and etc. supported directly on decompress */
- codecInfoDoes32 + codecInfoDoesSpool, /* depth and etc supported directly on compress */
- codecInfoDepth16, /* which data formats do we understand */
- 100, /* compress accuracy (0-255) (relative to format) */
- 100, /* decompress accuracy (0-255) (relative to format) */
- 100, /* millisecs to compress 320x240 image on base Mac */
- 100, /* millisecs to decompress 320x240 image on base Mac */
- 100, /* compression level (0-255) (relative to format) */
- 0,
- 2, /* minimum height */
- 2, /* minimum width */
- 0,
- 0,
- 0
- };
- #endif
-
- #if COMP_BUILD
- resource 'thng' (128, "Example Compressor",locked) {
- compressorComponentType,
- exampleCodecFormatType,
- 'appl',
- #if (!defined(POWERPC_FAT)) & (defined(POWERPC_NATIVE))
- 0x80000000,
- #else
- codecInfoDoes32,
- #endif
- 0,
- 'cdec',
- 128,
- 'STR ',
- 128,
- 'STR ',
- 129,
- 'ICON',
- 128,
- 0,
- #ifdef POWERPC_NATIVE
- componentHasMultiplePlatforms |
- #endif
- componentDoAutoVersion,
- 0,
- {
- #ifdef POWERPC_NATIVE
- #ifdef POWERPC_FAT
- codecInfoDoes32,
- 'cdec',
- 128,
- 1,
- #endif
- codecInfoDoes32,
- 'cdek',
- 128,
- 2,
- #endif
- },
- };
-
- resource 'ICON' (128, purgeable) {
- $"0003 8000 0004 C000 0004 C000 0004 C000"
- $"0004 C000 0004 C000 0004 C000 0004 C000"
- $"0004 C000 0004 C000 0004 C000 0004 C000"
- $"0004 C000 0004 C000 0004 C000 0004 C000"
- $"0004 C000 0004 C000 0004 C000 0007 C000"
- $"0008 6000 0018 7000 007F FC00 00C0 1E00"
- $"0180 1F00 0100 0F00 0100 0F00 0300 0F80"
- $"0200 0F80 03FF FF80 0C00 0FE0 0FFF FFE0"
- };
-
- resource 'STR ' (128) {
- "My Example Compressor"
- };
-
- resource 'STR ' (129) {
- "Compresses (in an exemplar fasion) an image into a YUVish format."
- };
-
-
- #endif // COMP_BUILD
-
- #if DECO_BUILD
- resource 'thng' (130, "Example Decompressor",locked) {
- decompressorComponentType,
- exampleCodecFormatType,
- 'appl',
- #if (!defined(POWERPC_FAT)) & (defined(POWERPC_NATIVE))
- 0x80000000,
- #else
- codecInfoDoes32,
- #endif
- 0,
- 'cdec',
- 129,
- 'STR ',
- 130,
- 'STR ',
- 131,
- 'ICON',
- 130,
- 0,
- #ifdef POWERPC_NATIVE
- componentHasMultiplePlatforms |
- #endif
- componentDoAutoVersion,
- 0,
- {
- #ifdef POWERPC_NATIVE
- #ifdef POWERPC_FAT
- codecInfoDoes32,
- 'cdec',
- 129,
- 1,
- #endif
- codecInfoDoes32,
- 'cdek',
- 129,
- 2
- #endif
- }
- };
-
- resource 'ICON' (130, purgeable) {
- $"0200 0F80 03FF FF80 0C00 0FE0 0FFF FFE0"
- $"0180 1F00 0100 0F00 0100 0F00 0300 0F80"
- $"0008 6000 0018 7000 007F FC00 00C0 1E00"
- $"0004 C000 0004 C000 0004 C000 0007 C000"
- $"0004 C000 0004 C000 0004 C000 0004 C000"
- $"0004 C000 0004 C000 0004 C000 0004 C000"
- $"0004 C000 0004 C000 0004 C000 0004 C000"
- $"0003 8000 0004 C000 0004 C000 0004 C000"
- };
-
- resource 'STR ' (130) {
- "My Example Decompressor"
- };
-
- resource 'STR ' (131) {
- "Decompresses an image compressed in YUVish format."
- };
-
-
- #endif DECO_BUILD
-
-
- #ifndef MW_REZ
-
- #ifdef POWERPC_NATIVE
-
- #if COMP_BUILD
- read 'cdek' (128, "Example Compressor") COMPPPC;
- #endif
-
- #if DECO_BUILD
- read 'cdek' (129, "Example Decompressor") DECOPPC;
- #endif
-
- #endif // POWERPC_NATIVE
-
- #if (defined(POWERPC_FAT)) | (!defined(POWERPC_NATIVE))
- #if COMP_BUILD
-
- data 'cdec' (128, "Example Compressor") {
-
- $$resource(COMP68K, 'cdec', 128);
-
- };
- #endif
-
- #if DECO_BUILD
- data 'cdec' (129, "Example Decompressor") {
-
- $$resource(DECO68K, 'cdec', 129);
-
- };
- #endif
-
- #endif
-
- #if USE_INIT_STUB
- data 'INIT' (0) {
-
- $$resource(INITSTUB, 'INIT', 0);
-
- };
- #endif
-
- #endif // MW_REZ
-